home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / setstrin.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  658 b   |  31 lines

  1. /*
  2. \funcref{setstring}{char $*$setstring (\params)}
  3.     {
  4.         {char} {*s} {string to set}
  5.     }
  6.     {duplicate of last pushed string}
  7.     {xrealloc(), xstrdup()}
  8.     {}
  9.     {setstrin.c}
  10.     {
  11.  
  12.         This function is called from {\em fun\_arg\_head()}, {\em
  13.         fun\_cmd\_head()}, etc., to set the appropriate strings to a duplicate
  14.         of the last pushed string.
  15.  
  16.         The argument {\em s} is freed if necessary. It should be the same
  17.         pointer variable which is assigned the return value.
  18.  
  19.     }
  20. */
  21.  
  22. #include "icm-exec.h"
  23.  
  24. char *setstring (char *s)
  25. {
  26.     xrealloc (s, 0);
  27.     s = xstrdup (stack [sp].vu.i->ls.str);
  28.  
  29.     return (s);
  30. }
  31.